`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date:    14:07:09 09/03/2012 
// Design Name: 
// Module Name:    main 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//////////////////////////////////////////////////////////////////////////////////
module main(rst_i,sensor_sync_i,walk_i,
	reprogram_i,Time_Parameter_Selector_i,Time_Value_i,clk_i,LEDs_o,cloo,display_o
    );
	 input rst_i;
	 input sensor_sync_i;
	 input walk_i;
	 input reprogram_i;
	 input [1:0] Time_Parameter_Selector_i;
	 input [3:0] Time_Value_i;
	 input clk_i;
	 output cloo;
	 output [3:0] display_o;
	 output [7:0] LEDs_o;
	 wire reprogram_o,reset_o,walk_o,walk_reset,clock1hz,expir;
	 wire [1:0] interval;
	 wire [3:0] value,segmentos_o;
	 wire [7:0] busLeds;

	 
	 TimeParameters magia(reprogram_o,interval,Time_Parameter_Selector_i,Time_Value_i,value,clk_i,reset_o);
	 
	 fms magia2(reset_o,sensor_sync_i,walk_o,walk_reset,reprogram_o,interval,expir,busLeds,clk_i);
    
	 sincronizador magia3(reprogram_i,rst_i,clk_i,reprogram_o,reset_o);
	 
	 timer magia4(value,expir,reset_o,clk_i);
	 
	 walk_register magia5(clk_i,reset_o,walk_i,walk_o,walk_reset);	
	 
	 Divider magia6(clk_i,reset_o,clock1hz);
	 
	 dis_peatonal magia7 (reset_o,value,walk_reset,clk_i,segmentos_o);
	 
	 assign LEDs_o=busLeds;
	 assign cloo=clock1hz;
	 assign display_o=segmentos_o;
	 
endmodule
